$(function () {
  var cApi = new common();

  var hostUrl = 'http://117.29.162.206:8089/'
  //alert(window.location.search);
  var billId = cApi.getQueryString('billId');
  var billKey = cApi.getQueryString('billKey');
  var jiamikey = cApi.getQueryString('aesKey');
  var appLoginToken = cApi.getQueryString('appLoginToken');
  var workItemId = cApi.getQueryString('workItemId');
  var username = cApi.getQueryStringActivity('username');
  var userdepartment = cApi.getQueryStringActivity('userdepartment');
  var usertime = strDateFormat(cApi.getQueryString('usertime'), 16);
  var type = cApi.getQueryString('type');
  var isApproval = cApi.getQueryString('isApproval');   //1表示是审批的 ，0表示其他的分类

  //var billId=39823144;
  //var billKey="Flow_ApplyLeave";
  //var jiamikey="1543486677028106";
  var jiamiiv = "16-Bytes--String";
  //var appLoginToken="24326d90d248497fba3cd5bb332a4134";
  var url;
  var zuizhongdata;//用来存放处理完成后的流程数据
  var fujian = [];//用来存放附件

  var isshenhe;
  //alert("ssss");
  //var username = "陈小编";
  //var userdepartment = "招商部";
  // var usertime = "2018-9-9 10:40";
  var userimg = "./start/img/tou.png";
  $('.head-avater img').attr('src', userimg);
  $('.userdata-name').text(username);
  $('.userdata-department').text(userdepartment);
  $('.userdata-time').text(usertime);

  var zhanshi, listdata, celist;
  var isbutton = true;//用于判断按钮是要显示同意（驳回）还是确定（取消）
  $('.reason').slideUp();//因为样式问题，所以一进入就执行以下向下动画


  var key = CryptoJS.enc.Utf8.parse(jiamikey);  //加密解密用的key
  var iv = CryptoJS.enc.Utf8.parse(jiamiiv);  //加密解密用的iv
  //$('#yulan').media({width:'100%', height:'100%',autoplay: true,src:'http://192.168.1.48:8089/erp/BillAttach/Flow_ApplyLeave/39820119/瑞石VI.pdf'});  
  // $('.media').media();
  

  ProcessDetails();

  
  //Review()
  //获取流程数据
  function ProcessDetails() {
    var dataweijiami = "{billId:'" + billId + "',billKey:'" + billKey + "'}"; //接口传递的参数
    var jianmidata = Encrypt(dataweijiami);  //进行aes加密
    var chanshu = "{appLoginToken:'" + appLoginToken + "',data:'" + jianmidata + "'}"; //数据拼接
    url = hostUrl + "Yigo1.6/services/MapWebService?wsdl"; //请求地址
    var fanhuidata = SoapRequest("WorkFlowWebService", "flowbill", chanshu, url); //调用请求
    var jiemifanhuidata = Decrypt(fanhuidata.data);  //请求成功返回的data进行解密
    zuizhongdata = JSON.parse(jiemifanhuidata); //解密后转成json格式

    //  附件数据填充
    for (let i = 0; i < zuizhongdata.billfile.length; i++) {
      fujian.push({ herf: zuizhongdata.billfile[i].filePath, fjm: zuizhongdata.billfile[i].fileName });
    }
    status = zuizhongdata.billhead[0].status == 0 ? "未提交" : zuizhongdata.billhead[0].status == 2 ? "审核中" : "已完成";
    if (zuizhongdata.billhead[0].status == 0 || zuizhongdata.billhead[0].status == 10) {
      $('.bottom-button').css('display', "none");
    } else {
      $('.bottom-button').css('display', "flex");
    }
    if(isApproval=="1"){
      // $('.bottom-button').css('display', "block");
     }else{
      $('.bottom-button').css('display', "none");
     }
    //状态填充
    $('.status-text').text(status);
    //数据填充
    tianchong(billKey);


    //填充完成后对文字长度的判断进而修改样式
    for (var i = 0; i < $('.starttime').length; i++) {
      if ($('.starttime').eq(i).height() > 42) {
        $('.starttime').eq(i).css('font-size', "12px");
      }
    }
    for (var j = 0; j < $('.a-d-d-l-d-content-content').length; j++) {
      if ($('.a-d-d-l-d-content-content').eq(j).text().length > 6) {
        var title = $('.a-d-d-l-d-content-title').eq(j).text();
        var content = $('.a-d-d-l-d-content-content').eq(j).text()
        var fudai = $('.a-d-d-l-d-content-content').eq(j).parent().parent().parent();
        $('.a-d-d-l-d-content-content').eq(j).parent().remove();
        j--;
        var ahtml = `<div class="a-d-d-l-d-content-two">
        <div class="a-d-d-l-d-content-two-div1">${title}:</div>
        <div class="a-d-d-l-d-content-two-div2">${content}</div>
      </div>`
        $(fudai).append(ahtml);
      }
    }
    console.log(zuizhongdata);
  }


  //审核函数
  function Review() {
    var reason = $('.reason-textarea').val();
    var dataweijiami = "{workItemId:'" + workItemId + "',auditReturn:'" + isshenhe + "',auditOpinion:'" + reason + "'}"; //接口传递的参数

    var jiamidata = Encrypt(dataweijiami);  //进行aes加密
    var chanshu = "{appLoginToken:'" + appLoginToken + "',data:'" + jiamidata + "'}"; //数据拼接
    url = hostUrl + "/Yigo1.6/services/MapWebService?wsdl"; //请求地址
    var fanhuidata = SoapRequest("WorkFlowWebService", "audit", chanshu, url); //调用请求
    var jiemifanhuidata = Decrypt(fanhuidata.data);  //请求成功返回的data进行解密
    var shenhefanhui = JSON.parse(jiemifanhuidata); //解密后转成json格式

    if (shenhefanhui.message == undefined) {
      if (type == 0) {
        window.webkit.messageHandlers.reload.postMessage("请求繁忙，请重新提交");
      } else {
        window.android.getResultMsg("请求繁忙，请重新提交");
      }
      $('.bottom-button-tjz').css('display', 'none');
      $('.bottom-button-div').css('display', 'flex');
    } else {
      if (type == 0) {
        window.webkit.messageHandlers.reload.postMessage(shenhefanhui.message);
      } else {
        window.android.getResultMsg(shenhefanhui.message);
      }
    }
  }

  //

  //请求函数
  function SoapRequest(interface, method, parameter) {
    var data;
    //SOAP 1.1 请求报文格式，1.2在网上可以找到
    data = `<?xml version="1.0" encoding="utf-8"?>`;
    data += `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://webservice.mid.myerp.bokesoft.com" xmlns:q0="http://schemas.xmlsoap.org/soap/encoding/" xmlns:something="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">`;
    data += `<soapenv:Body>`;
    data += `<ns0:unsafeInvokeService>`;
    data += `<sServiceName soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">${interface}</sServiceName>`;
    data += `<args q0:arrayType="xsd:anyType[2]" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="q0:Array">`;
    data += `<q0:string>${method}</q0:string>`;
    data += `<q0:string>${parameter}</q0:string>`;
    data += `</args>`;
    data += `</ns0:unsafeInvokeService>`;
    data += `</soapenv:Body>`;
    data += `</soapenv:Envelope>`;

    var xmlhttp = new XMLHttpRequest();
    var URL = url;
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/soap+xml; charset=utf-8"); //SOAP 1.1为text/xml ； 1.2为 application/soap+xml
    xmlhttp.setRequestHeader("SOAPAction", "wsdl");

    xmlhttp.send(data);




    var dd = xmlhttp.responseXML.getElementsByTagName("unsafeInvokeServiceReturn")[0];
    var ee = dd.innerHTML;
    var ff = JSON.parse(ee);

    return ff;

  }
  //aes加密
  function Encrypt(word) {
    srcs = CryptoJS.enc.Utf8.parse(word);
    var encrypted = CryptoJS.AES.encrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, Padding: CryptoJS.pad.Pkcs7 });
    return encrypted.ciphertext.toString().toUpperCase();
  }
  //aes解密
  function Decrypt(word) {
    var encryptedHexStr = CryptoJS.enc.Hex.parse(word);
    var srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
    var decrypt = CryptoJS.AES.decrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, Padding: CryptoJS.pad.Pkcs7 });
    var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
    return decryptedStr.toString();
  }



  //同意按钮点击事件
  $('#bottom-button-ty').on('click', function () {
    console.log($('#bottom-button-ty div').text())
    if ($('#bottom-button-ty div').text() == "确定") {
      // if (type == 0) {
      //   window.webkit.messageHandlers.Submission.postMessage();
      // } else {
      //   window.android.banReturn();
      // }
      $('.bottom-button-tjz').css('display', 'flex');
      $('.bottom-button-div').css('display', 'none');
      Review()
    } else {
      isshenhe = 1;
    }
    $('.reason-bohui').css('display', 'none');
    $('.reason-textarea').attr('placeholder', "请输入批准原因");
    buttonchange(isbutton)
  })
  //驳回按钮点击事件
  $('#bottom-button-bh').on('click', function () {
    console.log($('#bottom-button-bh div').text())
    if ($('#bottom-button-bh div').text() == "取消") {
      $('.reason-bohui').css('display', 'none');
      console.log($('.reason-textarea').val(""));
    }
    else {
      isshenhe = 0;
      $('.reason-bohui').css('display', 'flex');
    }
    $('.reason-textarea').attr('placeholder', "请输入驳回原因");
    buttonchange(isbutton)
  })
  //状态按钮点击事件
  $('.head-status').on('click', function () {
    if (type == 0) {
      window.webkit.messageHandlers.jump.postMessage(billId);
    } else {
      window.android.goApprovalFlow(billId);
    }
  })
  //附件点击事件
  var ii = 1;
  $('.Enclosure').on('click', function () {
    var fujianurl = $(this).attr("data-url");
    if (type == 0) {
      window.webkit.messageHandlers.Enclosure.postMessage(fujianurl);
    } else {
      window.android.showAnnex(fujianurl);
    }
  })
  //修改按钮文字与图标
  function buttonchange(isBut) {
    $('.reason').css('opacity', "1");
    if (isBut) {
      $('.reason').slideDown();
      $('#bottom-button-ty img').attr('src', "./start/img/qd.png");
      $('#bottom-button-ty div').text("确定");
      $('#bottom-button-bh img').attr('src', "./start/img/qx.png");
      $('#bottom-button-bh div').text("取消");
      isbutton = !isbutton;
    }
    else {
      $('.reason').slideUp();
      $('#bottom-button-ty img').attr('src', "./start/img/ty.png");
      $('#bottom-button-ty div').text("同意");
      $('#bottom-button-bh img').attr('src', "./start/img/bh.png");
      $('#bottom-button-bh div').text("驳回");
      isbutton = !isbutton;
    }
  }




  function tianchong(index) {
    var Data;
    var existsAttachment = true;// 用于设置是否显示附件
    var existsDetail = true;// 用于设置是否显示明细
    var detailTitle = "明细信息";// 用于设置明细标题
    $('.reason-bohui-name').text("发起人：" + zuizhongdata.billhead[0].creator);
    switch (index) {
      // case "Flow_ApplyLeave" :
      // var minxi = [];
      //   existsAttachment = false;
      //   existsDetail = false;
      //   Data = {
      //     jibenxinxi: [
      //       {leixing:"单据日期",neirong:'1111111111111'},
      //         {leixing:"申请人",neirong:'111111111111122'},
      //         {leixing:"部门",neirong:'111111111114444411'},
      //         {leixing:"类型",neirong:'111111111113431'},
      //         {leixing:"休假时长",neirong:'111111111113431'},
      //         {leixing:"休假时间",neirong:'111111111113431'},
      //         {leixing:"休假事由",neirong:'电饭锅电饭锅电饭锅电饭锅的'},
      //         {leixing:"附件",neirong:''}
      //     ],
      //     fujian: fujian,
      //     mingxi: {
      //       toubu: [],
      //       data: minxi,
      //     }
      //   }; break;
      // case "Flow_ApplyLeave" :Data=[
      //   {leixing:"单据日期",neirong:'1111111111111'},
      //   {leixing:"申请人",neirong:'111111111111122'},
      //   {leixing:"部门",neirong:'111111111114444411'},
      //   {leixing:"类型",neirong:'111111111113431'},
      //   {leixing:"休假时长",neirong:'111111111113431'},
      //   {leixing:"休假时间",neirong:'111111111113431'},
      //   {leixing:"休假事由",neirong:'电饭锅电饭锅电饭锅电饭锅的'},
      //   {leixing:"附件",neirong:''}
      // ];break;
      case "AM_Requisition":
        var minxi = [];
        detailTitle = "采购详情";
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push([zuizhongdata.billdtl[i].mtlName, zuizhongdata.billdtl[i].model, zuizhongdata.billdtl[i].qty, zuizhongdata.billdtl[i].unit,zuizhongdata.billdtl[i].dtlnotes])
        }
        console.log(minxi)
        Data = {
          jibenxinxi: [
            { leixing: "申购部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申购人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "申购原因", neirong: zuizhongdata.billhead[0].notes },
            { leixing: "备注", neirong: zuizhongdata.billhead[0].note }
          ],
          fujian: fujian,
          mingxi: {
            toubu: ["规格", "数量", "单位","备注"],
            data: minxi,
            showPage: 1,
          }
        }; break;
      case "SC_PayIn":
        var minxi = [];
        existsAttachment = false;
        existsDetail = false;
        Data = {
          jibenxinxi: [
            { leixing: "收款部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "收款人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "收款类型", neirong: zuizhongdata.billhead[0].payType },
            { leixing: "结算方式", neirong: zuizhongdata.billhead[0].settleMode },
            { leixing: "收款银行", neirong: zuizhongdata.billhead[0].bank },
            { leixing: "银行帐号", neirong: zuizhongdata.billhead[0].bankAccount },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].businessType },
            { leixing: "收款金额", neirong: zuizhongdata.billhead[0].sumMoney },
            { leixing: "备注", neirong: zuizhongdata.billhead[0].notes }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "Flow_Receptions":
        var minxi = [];
        detailTitle = "采购详情";
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push([zuizhongdata.billdtl[i].mtlName, zuizhongdata.billdtl[i].unit, zuizhongdata.billdtl[i].qty, zuizhongdata.billdtl[i].notes])
        }
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "紧急程度", neirong: zuizhongdata.billhead[0].emergency },
            { leixing: "需求时间", neirong: strDateFormat(zuizhongdata.billhead[0].requireDate, 10) }
          ],
          fujian: fujian,
          mingxi: {
            toubu: ["单位", "数量", "备注"],
            data: minxi,
            showPage: 1,
          }
        }; break;
      case "Flow_ApplyLeave":
        var minxi = [];
        existsDetail = false;
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "请假类别", neirong: zuizhongdata.billhead[0].leaveType },
            { leixing: "开始时间", neirong: zuizhongdata.billhead[0].leaveTimeFrom },
            { leixing: "结束时间", neirong: zuizhongdata.billhead[0].leaveTimeTo },
            { leixing: "请假天数", neirong: zuizhongdata.billhead[0].leaveDay },
            { leixing: "请假原因", neirong: zuizhongdata.billhead[0].reasons }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Cachet":
        var minxi = [];
        existsDetail = false;
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "需求时间", neirong: strDateFormat(zuizhongdata.billhead[0].needDate, 10) },
            { leixing: "归还日期", neirong: strDateFormat(zuizhongdata.billhead[0].backDate,10) },
            { leixing: "用章类型", neirong: strDateFormat(zuizhongdata.billhead[0].cachetType,10) },
            { leixing: "公章公司", neirong: zuizhongdata.billhead[0].company },
            { leixing: "公章数量", neirong: zuizhongdata.billhead[0].number },
            { leixing: "用章事由", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Contract":
        var minxi = [];
        existsDetail = false;
        Data = {
          jibenxinxi: [
            { leixing: "标题", neirong: zuizhongdata.billhead[0].billTitle },
            { leixing: "经办部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "经办人", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "合同类别", neirong: zuizhongdata.billhead[0].contractType },
            { leixing: "合同方", neirong: zuizhongdata.billhead[0].contractParty },
            { leixing: "归属部门", neirong: zuizhongdata.billhead[0].attachDept },
            { leixing: "合同日期", neirong: strDateFormat(zuizhongdata.billhead[0].contractDate, 10) },
            { leixing: "合同金额", neirong: zuizhongdata.billhead[0].contractMoney },
            { leixing: "条款概要", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Equipment":
        var minxi = [];
        detailTitle = "采购详情";
        for (var i = 0; i <  zuizhongdata.billdtl.length; i++) {
          minxi.push([zuizhongdata.billdtl[i].mtlName,zuizhongdata.billdtl[i].model,zuizhongdata.billdtl[i].qty, zuizhongdata.billdtl[i].unit,zuizhongdata.billdtl[i].notes])
        }
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "申购类型", neirong: zuizhongdata.billhead[0].applyType },
            { leixing: "紧急程度", neirong: zuizhongdata.billhead[0].emergency },
            { leixing: "申购金额", neirong: zuizhongdata.billhead[0].applyAmount },
            { leixing: "需求时间", neirong: strDateFormat(zuizhongdata.billhead[0].requireDate, 10) },
            { leixing: "用途", neirong: zuizhongdata.billhead[0].purpose}
          ],
          fujian: fujian,

          mingxi: {
            toubu: ["规格","数量", "单位", "备注"],
            data: minxi,
            showPage: 1,
          }
        }; break;
      case "Flow_HumanNeed":
        var minxi = [];
        existsAttachment = false;
        existsDetail = false;
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "招聘岗位", neirong: zuizhongdata.billhead[0].positions },
            { leixing: "招聘人数", neirong: zuizhongdata.billhead[0].peopleNumber },
            { leixing: "招聘原因", neirong: zuizhongdata.billhead[0].reason },
            { leixing: "希望到岗日期", neirong: strDateFormat(zuizhongdata.billhead[0].resultDate, 10) },
            { leixing: "性别", neirong: zuizhongdata.billhead[0].sex },
            { leixing: "年龄", neirong: zuizhongdata.billhead[0].age },
            { leixing: "婚否", neirong: zuizhongdata.billhead[0].marry },
            { leixing: "工作经验", neirong: zuizhongdata.billhead[0].workExper },
            { leixing: "专业及学历", neirong: zuizhongdata.billhead[0].education },
            { leixing: "资格证", neirong: zuizhongdata.billhead[0].certificate },
            { leixing: "其他", neirong: zuizhongdata.billhead[0].other },
            { leixing: "工作概述", neirong: zuizhongdata.billhead[0].workSummary },
            { leixing: "薪酬范围", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_InvestContract":
        existsDetail = false;
        var minxi = [];
        Data = {
          jibenxinxi: [
            { leixing: "标题", neirong: zuizhongdata.billhead[0].billTitle },
            { leixing: "经办部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "经办人", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "合同类别", neirong: zuizhongdata.billhead[0].contractType },
            { leixing: "客户名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "合同日期", neirong: strDateFormat(zuizhongdata.billhead[0].contractDate, 10) },
            { leixing: "合同金额", neirong: zuizhongdata.billhead[0].contractMoney },
            { leixing: "备注", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Payment":
        var minxi = [];
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push(["",zuizhongdata.billdtl[i].no,zuizhongdata.billdtl[i].dealerName, zuizhongdata.billdtl[i].money])
        }
        Data = {
          jibenxinxi: [
            { leixing: "标题", neirong: zuizhongdata.billhead[0].billTitle },
            { leixing: "经办部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "经办人", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "收款单位", neirong: zuizhongdata.billhead[0].payee },
            { leixing: "收款银行", neirong: zuizhongdata.billhead[0].bank },
            { leixing: "银行账号", neirong: zuizhongdata.billhead[0].bankAccount },
            { leixing: "合同金额", neirong: zuizhongdata.billhead[0].contractAmount },
            { leixing: "前期已付", neirong: zuizhongdata.billhead[0].prePayAmount },
            { leixing: "申请金额", neirong: zuizhongdata.billhead[0].applyAmountChinese },
            { leixing: "付款单位", neirong: zuizhongdata.billhead[0].payment },
            { leixing: "付款用途", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: ["单号","供应商", "金额"],
            data: minxi,
            showPage: 2
          }
        }; break;
      case "Flow_Purchase":
        var minxi = [];
        detailTitle = "采购详情";
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push([zuizhongdata.billdtl[i].mtlName, zuizhongdata.billdtl[i].qty, zuizhongdata.billdtl[i].unit, zuizhongdata.billdtl[i].price, zuizhongdata.billdtl[i].notes])
        }
        Data = {
          jibenxinxi: [
            { leixing: "标题", neirong: zuizhongdata.billhead[0].billTitle },
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "预算金额", neirong: zuizhongdata.billhead[0].budgetAmount },
            { leixing: "采购金额", neirong: zuizhongdata.billhead[0].purchaseAmount },
            { leixing: "用途", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: ["数量", "单位", "单价", "备注"],
            data: minxi,
            showPage: 1
          }
        }; break;
      case "Flow_Restaurant":
        var minxi = [];
        existsAttachment = false;
        existsDetail = false;
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "开始时间", neirong: strDateFormat(zuizhongdata.billhead[0].haveMealFrom, 16) },
            { leixing: "结束时间", neirong: strDateFormat(zuizhongdata.billhead[0].haveMealTo, 16) },
            { leixing: "用餐类型", neirong: zuizhongdata.billhead[0].haveMealType }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_SupplierConsume":
        var minxi = [];
        existsAttachment = false;
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push([zuizhongdata.billdtl[i].mtlName, zuizhongdata.billdtl[i].qty, zuizhongdata.billdtl[i].unit, zuizhongdata.billdtl[i].model, zuizhongdata.billdtl[i].price,  zuizhongdata.billdtl[i].mtlType,zuizhongdata.billdtl[i].notes])
        }
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "使用人", neirong: zuizhongdata.billhead[0].useEmpName },
            { leixing: "物品类型", neirong: zuizhongdata.billhead[0].supplierType },
            { leixing: "领用说明", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: ["数量", "单位", "规格", "单价","类别","备注"],
            data: minxi,
          }
        }; break;
      case "UseCar":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "使用人员", neirong: zuizhongdata.billhead[0].useEmp },
            { leixing: "用车类型", neirong: zuizhongdata.billhead[0].useCarType },
            { leixing: "用车时间", neirong: strDateFormat(zuizhongdata.billhead[0].useCarDate, 10) },
            { leixing: "使用公里数", neirong: zuizhongdata.billhead[0].usedNumber },
            { leixing: "用车区域", neirong: zuizhongdata.billhead[0].useCarRegion },
            { leixing: "用车事由", neirong: zuizhongdata.billhead[0].reason }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_InCachet":
        var minxi = [];
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push([zuizhongdata.billdtl[i].fileDetail, zuizhongdata.billdtl[i].cachetType, zuizhongdata.billdtl[i].number, zuizhongdata.billdtl[i].detail])
        }
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "用章事由", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: ["文件明细", "用印类型", "用印数量", "备注"],
            data: minxi,
            showPage: 4
          }
        }; break;

      case "Flow_BreakDown":
        var minxi = [];
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push([ "加班时间",zuizhongdata.billdtl[i].overtimeFrom, zuizhongdata.billdtl[i].overtimeTo])
        }
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "类型", neirong: zuizhongdata.billhead[0].leaveType },
            { leixing: "开始时间", neirong: zuizhongdata.billhead[0].leaveTimeFrom },
            { leixing: "结束时间", neirong: zuizhongdata.billhead[0].leaveTimeTo },
            { leixing: "休假时长", neirong: zuizhongdata.billhead[0].leaveDay + "天" },
            { leixing: "休假事由", neirong: zuizhongdata.billhead[0].reasons }
          ],
          fujian: fujian,

          mingxi: {
            toubu: ["加班开始时间", "加班结束时间"],
            data: minxi,
            showPage: 3,
          }
        }; break;
      case "Flow_RsPayment":
        var minxi = [];
        existsDetail = false;
        Data = {
          jibenxinxi: [
            { leixing: "标题", neirong: zuizhongdata.billhead[0].billTitle },
            { leixing: "经办部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "经办人", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "收款单位", neirong: zuizhongdata.billhead[0].payee },
            { leixing: "开户行", neirong: zuizhongdata.billhead[0].bank },
            { leixing: "银行账号", neirong: zuizhongdata.billhead[0].bankAccount },
            { leixing: "合同金额", neirong: zuizhongdata.billhead[0].contractAmount },
            { leixing: "前期已付", neirong: zuizhongdata.billhead[0].prePayAmount },
            { leixing: "申请金额", neirong: zuizhongdata.billhead[0].applyAmountChinese },
            { leixing: "付款用途", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Business":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "外出开始", neirong: strDateFormat(zuizhongdata.billhead[0].outTimeFrom, 16) },
            { leixing: "外出结束", neirong: strDateFormat(zuizhongdata.billhead[0].outTimeTo, 16) },
            { leixing: "返回开始", neirong: strDateFormat(zuizhongdata.billhead[0].backtimeFrom, 16) },
            { leixing: "返回结束", neirong: strDateFormat(zuizhongdata.billhead[0].backtimeTo, 16) },
            { leixing: "外出事由", neirong: zuizhongdata.billhead[0].reasons },
            { leixing: "外出天数", neirong: zuizhongdata.billhead[0].leaveDay },
            { leixing: "外出地点", neirong: zuizhongdata.billhead[0].place },
            { leixing: "交通工具", neirong: zuizhongdata.billhead[0].vehicle },
            { leixing: "是否订票", neirong: zuizhongdata.billhead[0].isBooking },
            { leixing: "订票备注", neirong: zuizhongdata.billhead[0].bookReason }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Quit":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "职务", neirong: zuizhongdata.billhead[0].position },
            { leixing: "入职时间", neirong: strDateFormat(zuizhongdata.billhead[0].entryDate, 10) },
            { leixing: "申请时间", neirong: strDateFormat(zuizhongdata.billhead[0].applyDate, 10) },
            { leixing: "预计离职", neirong: strDateFormat(zuizhongdata.billhead[0].quitDate, 10) },
            { leixing: "离职原因", neirong: zuizhongdata.billhead[0].reason }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Become":
        
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "职务", neirong: zuizhongdata.billhead[0].position },
            { leixing: "入职时间", neirong: strDateFormat(zuizhongdata.billhead[0].entryDate, 10) },
            { leixing: "学历", neirong: zuizhongdata.billhead[0].education },
            { leixing: "专业", neirong: zuizhongdata.billhead[0].major },
            { leixing: "试用开始", neirong: strDateFormat(zuizhongdata.billhead[0].tryTimeFrom, 10) },
            { leixing: "试用结束", neirong: strDateFormat(zuizhongdata.billhead[0].tryTimeTo, 10) },
            { leixing: "试用薪资", neirong: zuizhongdata.billhead[0].trySalary },
            { leixing: "转正薪资", neirong: zuizhongdata.billhead[0].cOSalary },
            { leixing: "个人评价", neirong: zuizhongdata.billhead[0].evaluate },
            { leixing: "工作内容", neirong: zuizhongdata.billhead[0].working }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_PostMove":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "原部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "原岗位职务", neirong: zuizhongdata.billhead[0].position },
            { leixing: "新岗位职务", neirong: zuizhongdata.billhead[0].nposition },
            { leixing: "新部门", neirong: zuizhongdata.billhead[0].ndeptName },
            { leixing: "离职原因", neirong: zuizhongdata.billhead[0].reason }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_EquipService":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "提出部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "提出人", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "申请类型", neirong: zuizhongdata.billhead[0].applyType },
            { leixing: "经办人", neirong: zuizhongdata.billhead[0].handleEmpName },
            { leixing: "经办部门", neirong: zuizhongdata.billhead[0].handleDeptName },
            { leixing: "需求日期", neirong: zuizhongdata.billhead[0].requireDate },
            { leixing: "内容描述", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_RsApplyLeave":
        var minxi = [];
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "请假类别", neirong: zuizhongdata.billhead[0].leaveType },
            { leixing: "开始时间", neirong: zuizhongdata.billhead[0].leaveTimeFrom },
            { leixing: "结束时间", neirong: zuizhongdata.billhead[0].leaveTimeTo },
            { leixing: "请假天数", neirong: zuizhongdata.billhead[0].leaveDay + "天" },
            { leixing: "请假原因", neirong: zuizhongdata.billhead[0].reasons }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_RsBreakDown":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push(["加班时间", zuizhongdata.billdtl[i].overtimeFrom, zuizhongdata.billdtl[i].overtimeTo])
        }
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "类型", neirong: zuizhongdata.billhead[0].leaveType },
            { leixing: "开始时间", neirong: zuizhongdata.billhead[0].leaveTimeFrom,  },
            { leixing: "结束时间", neirong: zuizhongdata.billhead[0].leaveTimeTo},
            { leixing: "休假时长", neirong: zuizhongdata.billhead[0].leaveDay + "天" },
            { leixing: "休假事由", neirong: zuizhongdata.billhead[0].reasons }
          ],
          fujian: fujian,

          mingxi: {
            toubu: ["加班开始时间", "加班结束时间"],
            data: minxi,
            showPage :3,
          }
        }; 
  
        break;
      case "Flow_FixedAssets":
        var minxi = [];
        detailTitle = "采购详情";
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push([zuizhongdata.billdtl[i].mtlName,zuizhongdata.billdtl[i].model,zuizhongdata.billdtl[i].qty, zuizhongdata.billdtl[i].unit, zuizhongdata.billdtl[i].notes])
        }
        console.log(minxi)
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "紧急程度", neirong: zuizhongdata.billhead[0].emergency },
            { leixing: "需求时间", neirong: strDateFormat(zuizhongdata.billhead[0].requireDate, 10) }
          ],
          fujian: fujian,

          mingxi: {
            toubu: ["规格","数量", "单位", "备注"],
            data: minxi,
            showPage:1,
          }
        }; break;
      case "Flow_WasteDisposal":
        var minxi = [];
        for (var i = 0; i < zuizhongdata.billdtl.length; i++) {
          minxi.push([zuizhongdata.billdtl[i].mtlName,zuizhongdata.billdtl[i].model, zuizhongdata.billdtl[i].qty, zuizhongdata.billdtl[i].unit,zuizhongdata.billdtl[i].notes])
        }
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },           
            { leixing: "预算金额", neirong: zuizhongdata.billhead[0].sumMoney },           
              ],
          fujian: fujian,

          mingxi: {
            toubu: ["规格","数量", "单位", "备注"],
            data: minxi,
            showPage:1,
          }
        }; break;
      case "Flow_UsedIdle":
        var minxi = [];
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "设备类", neirong: zuizhongdata.billhead[0].type },
            { leixing: "名称", neirong: zuizhongdata.billhead[0].name },
            { leixing: "规格型号", neirong: zuizhongdata.billhead[0].model },
            { leixing: "开始日期", neirong: strDateFormat(zuizhongdata.billhead[0].usedDateFrom, 10) },
            { leixing: "结束日期", neirong: strDateFormat(zuizhongdata.billhead[0].usedDateTo, 10) },
            { leixing: "处理原因", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,

          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Advertising":
        var minxi = [];
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "紧急程度", neirong: zuizhongdata.billhead[0].emergency },
            { leixing: "需求时间", neirong: strDateFormat(zuizhongdata.billhead[0].requireDate, 10) },
            { leixing: "项目类型", neirong: zuizhongdata.billhead[0].projectType },
            { leixing: "用途说明", neirong: zuizhongdata.billhead[0].purpose },
            { leixing: "项目内容", neirong: zuizhongdata.billhead[0].projectContent }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_FileUpdate":
        var minxi = [];
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "岗位", neirong: zuizhongdata.billhead[0].position },
            { leixing: "申请日期", neirong: strDateFormat(zuizhongdata.billhead[0].applyDate, 10) },
            { leixing: "文件名", neirong: zuizhongdata.billhead[0].fileName },
            { leixing: "文件编号", neirong: zuizhongdata.billhead[0].fileCode },
            { leixing: "当前版本", neirong: zuizhongdata.billhead[0].edition },
            { leixing: "文件类型", neirong: zuizhongdata.billhead[0].fileType },
            { leixing: "需求类别", neirong: zuizhongdata.billhead[0].requireType },
            { leixing: "修改页次", neirong: zuizhongdata.billhead[0].updatePage },
            { leixing: "申请原因", neirong: zuizhongdata.billhead[0].result },
            { leixing: "生效日期", neirong: strDateFormat(zuizhongdata.billhead[0].startDate, 10) },
            { leixing: "会签部门", neirong: zuizhongdata.billhead[0].attachDept },
            { leixing: "改前内容", neirong: zuizhongdata.billhead[0].startContent },
            { leixing: "改后内容", neirong: zuizhongdata.billhead[0].endContent }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Chapter":
        var minxi = [];
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "印章类别", neirong: zuizhongdata.billhead[0].chapterType },
            { leixing: "申请日期", neirong: strDateFormat(zuizhongdata.billhead[0].billdate, 10) },
            { leixing: "印章内容", neirong: zuizhongdata.billhead[0].chapterContent },
            { leixing: "印章材质", neirong: zuizhongdata.billhead[0].chapterQuality },
            { leixing: "刻章情况", neirong: zuizhongdata.billhead[0].chapterSituation },
            { leixing: "保管人", neirong: zuizhongdata.billhead[0].chapterEmpName },
            { leixing: "启用日期", neirong: strDateFormat(zuizhongdata.billhead[0].startDate, 10) },
            { leixing: "印章尺寸", neirong: zuizhongdata.billhead[0].chapterSize },
            { leixing: "数量", neirong: zuizhongdata.billhead[0].number },
            { leixing: "申请原因", neirong: zuizhongdata.billhead[0].content }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_VehicleReservation":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "岗位", neirong: zuizhongdata.billhead[0].position },
            { leixing: "接待人", neirong: zuizhongdata.billhead[0].reEmpName },
            { leixing: "客户姓名", neirong: zuizhongdata.billhead[0].name },
            { leixing: "客户手机", neirong: zuizhongdata.billhead[0].tel },
            { leixing: "客户车牌", neirong: zuizhongdata.billhead[0].lPNo },
            { leixing: "进入时间", neirong: strDateFormat(zuizhongdata.billhead[0].dtvalid, 19) },
            { leixing: "进入原因", neirong: zuizhongdata.billhead[0].content }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_SaleContract":
        var minxi = [];
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "经办部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "经办人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "合同名称", neirong: zuizhongdata.billhead[0].contractName },
            { leixing: "合同编号", neirong: zuizhongdata.billhead[0].contractCode },
            { leixing: "合同方", neirong: zuizhongdata.billhead[0].ownerName },
            { leixing: "合同类型", neirong: zuizhongdata.billhead[0].contractType },
            { leixing: "归属人", neirong: zuizhongdata.billhead[0].gempName },
            { leixing: "归属部门", neirong: zuizhongdata.billhead[0].gdeptName },
            { leixing: "合同金额", neirong: zuizhongdata.billhead[0].contractMoney },
            { leixing: "报审日期", neirong: strDateFormat(zuizhongdata.billhead[0].contractDate, 10) },
            { leixing: "质保金", neirong: zuizhongdata.billhead[0].guaranteeMoney },
            { leixing: "条款概要", neirong: zuizhongdata.billhead[0].purpose }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "BM_OutNotice":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
       
        var jibenxinxi=[];
        if(zuizhongdata.billhead[0].isOut=="自购"||zuizhongdata.billhead[0].isOut=="客户"){
          jibenxinxi=[
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "客户名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "总颗数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总立方数", neirong: zuizhongdata.billhead[0].totalVolume },
            // { leixing: "荒料库存", neirong: zuizhongdata.billhead[0].BM_Volume + "m³" },
            // { leixing: "大板库存", neirong: zuizhongdata.billhead[0].SL_Area + "㎡" },
            { leixing: "发货金额", neirong: zuizhongdata.billhead[0].sendMoney },
            { leixing: "已交款", neirong: zuizhongdata.billhead[0].payMoney },
            { leixing: "工程名称", neirong: zuizhongdata.billhead[0].proName },
            { leixing: "工程订单", neirong: zuizhongdata.billhead[0].projectNo },
            { leixing: "供应商", neirong: zuizhongdata.billhead[0].supplierName }
          ]
        }else{
          jibenxinxi=[
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "总颗数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总立方数", neirong: zuizhongdata.billhead[0].totalVolume },
            { leixing: "仓储截止", neirong: strDateFormat(zuizhongdata.billhead[0].Date_W, 10) },
            { leixing: "总欠款", neirong: zuizhongdata.billhead[0].arrMoney },
            { leixing: "仓储应收", neirong: zuizhongdata.billhead[0].OW_Money_E },
            { leixing: "大板应收", neirong: zuizhongdata.billhead[0].OS_Money_E },
            { leixing: "保税应收", neirong: zuizhongdata.billhead[0].OB_Money_E },
            { leixing: "加工截止", neirong: strDateFormat(zuizhongdata.billhead[0].Date_P, 10) },
            { leixing: "加工应收", neirong: zuizhongdata.billhead[0].OP_Money_E },
            { leixing: "总欠款:", neirong: ""},
            { leixing: "仓储应收", neirong: zuizhongdata.billhead[0].W_Money_E },
            { leixing: "加工应收", neirong: zuizhongdata.billhead[0].P_Money_E },
            { leixing: "大板应收", neirong: zuizhongdata.billhead[0].S_Money_E },
            { leixing: "保税应收", neirong: zuizhongdata.billhead[0].B_Money_E },
            { leixing: "荒料库存", neirong: zuizhongdata.billhead[0].BM_Volume + "m³" },
            { leixing: "大板库存", neirong: zuizhongdata.billhead[0].SL_Area + "㎡" }
          ]
        }
        Data = {
          jibenxinxi:jibenxinxi,
          // jibenxinxi: [
          //   { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
          //   { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
          //   { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
          //   { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
          //   { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
          //   // 自购&&客户  显示客户名称   货主&&外协   显示货主名称
          //   { leixing: "客户名称", neirong: zuizhongdata.billhead[0].deaName },
          //   { leixing: "总颗数", neirong: zuizhongdata.billhead[0].totalQty },
          //   { leixing: "总立方数", neirong: zuizhongdata.billhead[0].totalVolume },
            
          //   // 货主&&外协  
          //   { leixing: "仓储截止", neirong: strDateFormat(zuizhongdata.billhead[0].Date_W, 10) },
          //   { leixing: "总欠款", neirong: zuizhongdata.billhead[0].arrMoney },
          //   { leixing: "仓储应收", neirong: zuizhongdata.billhead[0].OW_Money_E },
          //   { leixing: "大板应收", neirong: zuizhongdata.billhead[0].OS_Money_E },
          //   { leixing: "保税应收", neirong: zuizhongdata.billhead[0].OB_Money_E },
          //   { leixing: "加工截止", neirong: strDateFormat(zuizhongdata.billhead[0].Date_P, 10) },
          //   { leixing: "加工应收", neirong: zuizhongdata.billhead[0].OP_Money_E },
          //   { leixing: "总欠款", neirong: ""},
          //   { leixing: "仓储应收", neirong: zuizhongdata.billhead[0].W_Money_E },
          //   { leixing: "加工应收", neirong: zuizhongdata.billhead[0].P_Money_E },
          //   { leixing: "大板应收", neirong: zuizhongdata.billhead[0].S_Money_E },
          //   { leixing: "保税应收", neirong: zuizhongdata.billhead[0].B_Money_E },
           
          //  //
          //   { leixing: "荒料库存", neirong: zuizhongdata.billhead[0].BM_Volume + "m³" },
          //   { leixing: "大板库存", neirong: zuizhongdata.billhead[0].SL_Area + "㎡" }

          //   //自购&&客户
            
            
          // ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; 
        
        
        break;
      case "SL_OutNotice":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        var jibenxinxi=[];
        if(zuizhongdata.billhead[0].isOut=="自购"||zuizhongdata.billhead[0].isOut=="客户"){
          jibenxinxi=[
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "客户名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "总片数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总匝数", neirong: zuizhongdata.billhead[0].totalTurns },
            { leixing: "总面积数", neirong: zuizhongdata.billhead[0].totalArea },
            // { leixing: "荒料库存", neirong: zuizhongdata.billhead[0].BM_Volume + "m³" },
            // { leixing: "大板库存", neirong: zuizhongdata.billhead[0].SL_Area + "㎡" },
            { leixing: "发货金额", neirong: zuizhongdata.billhead[0].sendMoney },
            { leixing: "已交款", neirong: zuizhongdata.billhead[0].payMoney },
            { leixing: "工程名称", neirong: zuizhongdata.billhead[0].proName },
            { leixing: "工程订单", neirong: zuizhongdata.billhead[0].projectNo },
            { leixing: "供应商", neirong: zuizhongdata.billhead[0].supplierName }
          ]
        }else{
          jibenxinxi=[
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "总片数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总匝数", neirong: zuizhongdata.billhead[0].totalTurns },
            { leixing: "总面积数", neirong: zuizhongdata.billhead[0].totalArea },
            { leixing: "仓储截止", neirong: strDateFormat(zuizhongdata.billhead[0].Date_W, 10) },
            { leixing: "总欠款", neirong: zuizhongdata.billhead[0].arrMoney },
            { leixing: "仓储应收", neirong: zuizhongdata.billhead[0].OW_Money_E },
            { leixing: "大板应收", neirong: zuizhongdata.billhead[0].OS_Money_E },
            { leixing: "保税应收", neirong: zuizhongdata.billhead[0].OB_Money_E },
            { leixing: "加工截止", neirong: strDateFormat(zuizhongdata.billhead[0].Date_P, 10) },
            { leixing: "加工应收", neirong: zuizhongdata.billhead[0].OP_Money_E },
            { leixing: "总欠款:", neirong: ""},
            { leixing: "仓储应收", neirong: zuizhongdata.billhead[0].W_Money_E },
            { leixing: "加工应收", neirong: zuizhongdata.billhead[0].P_Money_E },
            { leixing: "大板应收", neirong: zuizhongdata.billhead[0].S_Money_E },
            { leixing: "保税应收", neirong: zuizhongdata.billhead[0].B_Money_E },
            { leixing: "荒料库存", neirong: zuizhongdata.billhead[0].BM_Volume + "m³" },
            { leixing: "大板库存", neirong: zuizhongdata.billhead[0].SL_Area + "㎡" }
          ]
        }
        Data = {
          jibenxinxi:jibenxinxi,
          // jibenxinxi: [
          //   { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
          //   { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
          //   { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
          //   { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
          //   { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
          //   { leixing: "客户名称", neirong: zuizhongdata.billhead[0].deaName },
          //   { leixing: "总片数", neirong: zuizhongdata.billhead[0].totalQty },
          //   { leixing: "总匝数", neirong: zuizhongdata.billhead[0].totalTurns },
          //   { leixing: "总平方数", neirong: zuizhongdata.billhead[0].totalArea },
          //   { leixing: "仓储截止", neirong: strDateFormat(zuizhongdata.billhead[0].Date_W, 10) },
          //   { leixing: "总欠款", neirong: zuizhongdata.billhead[0].arrMoney },
          //   { leixing: "仓储应收", neirong: zuizhongdata.billhead[0].OW_Money_E },
          //   { leixing: "大板应收", neirong: zuizhongdata.billhead[0].OS_Money_E },
          //   { leixing: "保税应收", neirong: zuizhongdata.billhead[0].OB_Money_E },
          //   { leixing: "加工截止", neirong: strDateFormat(zuizhongdata.billhead[0].Date_P, 10) },
          //   { leixing: "加工应收", neirong: zuizhongdata.billhead[0].OP_Money_E },
          //   { leixing: "仓储应收", neirong: zuizhongdata.billhead[0].W_Money_E },
          //   { leixing: "加工应收", neirong: zuizhongdata.billhead[0].P_Money_E },
          //   { leixing: "大板应收", neirong: zuizhongdata.billhead[0].S_Money_E },
          //   { leixing: "保税应收", neirong: zuizhongdata.billhead[0].B_Money_E },
          //   { leixing: "荒料库存", neirong: zuizhongdata.billhead[0].BM_Volume + "m³" },
          //   { leixing: "大板库存", neirong: zuizhongdata.billhead[0].SL_Area + "㎡" }
          // ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "SM_SendNotice":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "订单名称", neirong: zuizhongdata.billhead[0].projectName },
            { leixing: "总单号", neirong: zuizhongdata.billhead[0].projectHNumber },
            { leixing: "订单号", neirong: zuizhongdata.billhead[0].projectNumber },
            { leixing: "订单号", neirong: zuizhongdata.billhead[0].projectNo },
            { leixing: "总片数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总箱数", neirong: zuizhongdata.billhead[0].totalTurns },
            { leixing: "总面积", neirong: zuizhongdata.billhead[0].totalArea + "㎡" }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "SM_Transfer":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "工程名称", neirong: zuizhongdata.billhead[0].projectName },
            { leixing: "工程总单号", neirong: zuizhongdata.billhead[0].projectHNumber },
            { leixing: "订单号", neirong: zuizhongdata.billhead[0].projectNo },
            { leixing: "总片数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总箱数", neirong: zuizhongdata.billhead[0].totalTurns },
            { leixing: "总面积", neirong: zuizhongdata.billhead[0].totalArea + "㎡" }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "BS_OutNotice":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "总颗数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总立方数", neirong: zuizhongdata.billhead[0].totalVolume + "m³" }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "BM_Transfer":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申购部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申购人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            // { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            // { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "工程名称", neirong: zuizhongdata.billhead[0].projectName },
            { leixing: "订单号", neirong: zuizhongdata.billhead[0].projectNo },
            { leixing: "移出仓库", neirong: zuizhongdata.billhead[0].owarehouse },
            { leixing: "移出库区", neirong: zuizhongdata.billhead[0].ostoreArea },
            { leixing: "移入仓库", neirong: zuizhongdata.billhead[0].nwarehouse },
            { leixing: "移入库区", neirong: zuizhongdata.billhead[0].nstoreArea },
            { leixing: "总颗数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总立方数", neirong: zuizhongdata.billhead[0].totalVolume + "m³" }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "SL_Transfer":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申购部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申购人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            //{ leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
           // { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "订单名称", neirong: zuizhongdata.billhead[0].projectName },
            { leixing: "订单号", neirong: zuizhongdata.billhead[0].projectNo },
            { leixing: "移出仓库", neirong: zuizhongdata.billhead[0].owarehouse },
            { leixing: "移出库区", neirong: zuizhongdata.billhead[0].ostoreArea },
            { leixing: "移入仓库", neirong: zuizhongdata.billhead[0].nwarehouse },
            { leixing: "移入库区", neirong: zuizhongdata.billhead[0].nstoreArea },
            { leixing: "总片数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总匝数", neirong: zuizhongdata.billhead[0].totalTurns },
            { leixing: "总面积", neirong: zuizhongdata.billhead[0].totalArea + "m³" }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "ES_Transfer":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "工程名称", neirong: zuizhongdata.billhead[0].projectName },
            { leixing: "订单号", neirong: zuizhongdata.billhead[0].projectNo },
            { leixing: "移出仓库", neirong: zuizhongdata.billhead[0].owarehouse },
            { leixing: "移出库区", neirong: zuizhongdata.billhead[0].ostoreArea },
            { leixing: "移入仓库", neirong: zuizhongdata.billhead[0].nwarehouse },
            { leixing: "移入库区", neirong: zuizhongdata.billhead[0].nstoreArea },
            { leixing: "总片数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总箱数", neirong: zuizhongdata.billhead[0].totalTurns },
            { leixing: "总平方数", neirong: zuizhongdata.billhead[0].totalVolume + "㎡" }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

      case "BL_OutNotice":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "所属部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "人员", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "业务类别", neirong: zuizhongdata.billhead[0].isOut },
            { leixing: "仓库", neirong: zuizhongdata.billhead[0].whsName },
            { leixing: "库区", neirong: zuizhongdata.billhead[0].storeAreaName },
            { leixing: "货主名称", neirong: zuizhongdata.billhead[0].deaName },
            { leixing: "总片数", neirong: zuizhongdata.billhead[0].totalQty },
            { leixing: "总匝数", neirong: zuizhongdata.billhead[0].totalTurns },
            { leixing: "总平方数", neirong: zuizhongdata.billhead[0].totalVolume + "㎡" }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
        case "Entertain":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "招待人数", neirong: zuizhongdata.billhead[0].liveNumber },
            { leixing: "房间数量", neirong: zuizhongdata.billhead[0].roomNumber },
            { leixing: "住宿人姓名", neirong: zuizhongdata.billhead[0].liveName },
            { leixing: "住宿人单位", neirong: zuizhongdata.billhead[0].liveCompany },
            { leixing: "住宿人职务", neirong: zuizhongdata.billhead[0].livePost },
            { leixing: "拟入住日期", neirong: zuizhongdata.billhead[0].checkInDate },
            { leixing: "拟离店日期", neirong: zuizhongdata.billhead[0].leaveDate },
            { leixing: "招待事由", neirong: zuizhongdata.billhead[0].reason }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_ApplyActivity":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "活动日期", neirong: zuizhongdata.billhead[0].activityDate },
            { leixing: "预计金额", neirong: zuizhongdata.billhead[0].money },
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "经办人", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "归属部门", neirong: zuizhongdata.billhead[0].oDeptName },
            { leixing: "申请原因", neirong: zuizhongdata.billhead[0].reason }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;
      case "Flow_Entertain":
        var minxi = [];
        existsAttachment = false;// 该流程无附件
        existsDetail = false;// 该流程无明细
        Data = {
          jibenxinxi: [
            { leixing: "申请部门", neirong: zuizhongdata.billhead[0].deptName },
            { leixing: "申请人", neirong: zuizhongdata.billhead[0].empName },
            { leixing: "归属部门", neirong: zuizhongdata.billhead[0].oDeptName },
            { leixing: "申请类型", neirong: zuizhongdata.billhead[0].applyType },
            { leixing: "预计金额", neirong: zuizhongdata.billhead[0].money },
            { leixing: "招待事由", neirong: zuizhongdata.billhead[0].reason }
          ],
          fujian: fujian,
          mingxi: {
            toubu: [],
            data: minxi,
          }
        }; break;

    }

    listdata = {
      data: Data
    }
    
    listdata.data.existsAttachment = existsAttachment;  // 用于设置是否显示附件
    listdata.data.existsDetail = existsDetail ; // 用于设置是否显示明细
    listdata.data.detailTitle = detailTitle ; // 用于设置明细标题
    var zhanshi = document.getElementById('zhanshi').innerHTML;

    celist = juicer(zhanshi, listdata);
    $('.approval-data').empty().append(celist);

  }
})